﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Fjaspx.UI.Web;

namespace Fjaspx.UCenter
{
    public partial class Uploadpic : UserPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void Button_Pooto_Click(object sender, EventArgs e)
        {
            string fileContentType = FileUpload_Pooto.PostedFile.ContentType;
            string name = FileUpload_Pooto.PostedFile.FileName;
            string filename = null;
            if (fileContentType == "image/bmp" || fileContentType == "image/gif" || fileContentType == "image/pjpeg")
            {
                filename = "/App_Pic/UcenterPoto/" + Fjaspx.Common.Session.Get("user") + "_" + DateTime.Now.ToString("yyyy-MM-dd-hh-mm-ss") + name.Substring(name.LastIndexOf("."), name.Length - name.LastIndexOf("."));
                FileUpload_Pooto.SaveAs(Server.MapPath(filename));
                Response.Redirect("PeopleDate.aspx?pic=" + filename);
               
            }
        }
    }
}
